package com.atcd.springboot2.controller;



import com.atcd.springboot2.bean.User;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

//@ResponseBody//类里面的return都是返回body的数据，而不是跳转
//@Controller
@RestController //ResponseBody和Controller结合为RestController

public class UserController {

        @RequestMapping("/hello")
        public String handle01(){

            return "你好, Spring Boot 2!";
        }

        @GetMapping("/saveUser")
    public User saveUser(User user){//接收一个对象
       return  user;
       //{"username":"admin","password":"weafawefaw","student":{"studentNumber":22222,"studentName":"tw1"}}
        }

        //测试json

}
